package main

import (
	"fmt"
	"github.com/17683954109/Tiny_GO/socket"
)

func main()  {
	socket.NewSocket("tcp", ":3333", func(msg string, conn *socket.Socket) {
		fmt.Println("Client -> " + conn.RemoteAddr.String() + " : " + msg)
		if msg == "exit" {
			_ = conn.Close()
		}else{
			_ = conn.Write(msg + "\r\n")
			fmt.Println("Client <- " + conn.RemoteAddr.String() + " : " + msg)
		}
	})
}
